home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / toolbar / spltrcls / vsplittr.frm < prev    next >
Text File  |  1995-11-14  |  5KB  |  172 lines

  1. VERSION 4.00
  2. Begin VB.Form frmVSplitter 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00C0C0C0&
  5.    Caption         =   "Vertical Splitter Test"
  6.    ClientHeight    =   2865
  7.    ClientLeft      =   1380
  8.    ClientTop       =   1710
  9.    ClientWidth     =   5595
  10.    ClipControls    =   0   'False
  11.    DrawMode        =   10  'Mask Pen
  12.    DrawStyle       =   6  'Inside Solid
  13.    DrawWidth       =   4
  14.    FillStyle       =   0  'Solid
  15.    BeginProperty Font 
  16.       name            =   "MS Sans Serif"
  17.       charset         =   0
  18.       weight          =   700
  19.       size            =   8.25
  20.       underline       =   0   'False
  21.       italic          =   0   'False
  22.       strikethrough   =   0   'False
  23.    EndProperty
  24.    ForeColor       =   &H00808080&
  25.    Height          =   3270
  26.    Left            =   1320
  27.    LinkMode        =   1  'Source
  28.    LinkTopic       =   "NoteMain"
  29.    LockControls    =   -1  'True
  30.    ScaleHeight     =   2865
  31.    ScaleWidth      =   5595
  32.    Top             =   1365
  33.    Width           =   5715
  34.    Begin VB.PictureBox picVContainer 
  35.       Appearance      =   0  'Flat
  36.       BackColor       =   &H00C0C0C0&
  37.       BorderStyle     =   0  'None
  38.       ForeColor       =   &H80000008&
  39.       Height          =   2640
  40.       Left            =   105
  41.       ScaleHeight     =   2640
  42.       ScaleWidth      =   5370
  43.       TabIndex        =   0
  44.       Top             =   105
  45.       Width           =   5370
  46.       Begin VB.PictureBox picVSplitter 
  47.          BackColor       =   &H00C0C0C0&
  48.          BorderStyle     =   0  'None
  49.          DrawMode        =   1  'Blackness
  50.          DrawStyle       =   5  'Transparent
  51.          Height          =   2430
  52.          Left            =   2625
  53.          MouseIcon       =   "VSplittr.frx":0000
  54.          MousePointer    =   99  'Custom
  55.          ScaleHeight     =   2430
  56.          ScaleWidth      =   45
  57.          TabIndex        =   1
  58.          Top             =   105
  59.          Width           =   45
  60.       End
  61.       Begin VB.TextBox txtLeft 
  62.          BeginProperty Font 
  63.             name            =   "MS Sans Serif"
  64.             charset         =   0
  65.             weight          =   400
  66.             size            =   8.25
  67.             underline       =   0   'False
  68.             italic          =   0   'False
  69.             strikethrough   =   0   'False
  70.          EndProperty
  71.          ForeColor       =   &H00000000&
  72.          Height          =   2430
  73.          Left            =   105
  74.          MultiLine       =   -1  'True
  75.          ScrollBars      =   2  'Vertical
  76.          TabIndex        =   3
  77.          Text            =   "VSplittr.frx":0152
  78.          Top             =   105
  79.          Width           =   2535
  80.       End
  81.       Begin VB.TextBox txtRight 
  82.          BeginProperty Font 
  83.             name            =   "MS Sans Serif"
  84.             charset         =   0
  85.             weight          =   400
  86.             size            =   8.25
  87.             underline       =   0   'False
  88.             italic          =   0   'False
  89.             strikethrough   =   0   'False
  90.          EndProperty
  91.          ForeColor       =   &H00000000&
  92.          Height          =   2430
  93.          Left            =   2730
  94.          MultiLine       =   -1  'True
  95.          ScrollBars      =   2  'Vertical
  96.          TabIndex        =   2
  97.          Text            =   "VSplittr.frx":0212
  98.          Top             =   105
  99.          Width           =   2535
  100.       End
  101.    End
  102. End
  103. Attribute VB_Name = "frmVSplitter"
  104. Attribute VB_Creatable = False
  105. Attribute VB_Exposed = False
  106. Option Explicit
  107.  
  108. ' form position constants
  109. Const FORM_LEFT = 0
  110. Const FORM_TOP = 0
  111.  
  112. ' splitter position and offsets
  113. Const SPLITTER_LEFT = 105
  114. Const SPLITTER_TOP = 105
  115. Const SPLITTER_WIDTH_OFFSET = 315
  116. Const SPLITTER_HEIGHT_OFFSET = 600
  117.  
  118. ' splitter object
  119. Dim moVSplitter As CVerticalSplitter
  120.  
  121. Private Sub Form_Load()
  122.  
  123.    ' position
  124.    Me.Move FORM_LEFT, FORM_TOP
  125.    
  126.    ' instantiate the splitter object
  127.    Set moVSplitter = New CVerticalSplitter
  128.    moVSplitter.Init picVContainer, picVSplitter, _
  129.       txtLeft, txtRight
  130.  
  131. End Sub
  132.  
  133. Private Sub Form_Resize()
  134.  
  135.    ' resize the container
  136.    If Me.WindowState <> vbMinimized Then
  137.       moVSplitter.Move SPLITTER_LEFT, _
  138.          SPLITTER_TOP, _
  139.          Me.Width - SPLITTER_WIDTH_OFFSET, _
  140.          Me.Height - SPLITTER_HEIGHT_OFFSET
  141.    End If
  142.  
  143. End Sub
  144.  
  145. Private Sub Form_Unload(Cancel As Integer)
  146.    
  147.    ' release the splitter object
  148.    Set moVSplitter = Nothing
  149.    
  150. End Sub
  151.  
  152. Private Sub picVSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  153.    
  154.    ' record event
  155.    moVSplitter.MouseDown
  156.    
  157. End Sub
  158.  
  159. Private Sub picVSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  160.    
  161.    ' record event
  162.    moVSplitter.MouseMove X
  163.  
  164. End Sub
  165.  
  166. Private Sub picVSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  167.    
  168.    ' record event
  169.    moVSplitter.MouseUp
  170.  
  171. End Sub
  172.